package com.py.my.tools;

import java.io.File;
import java.util.HashSet;

import org.apache.commons.io.FileUtils;

public class XMLFileFilter {
	
	static HashSet<String> activityXML = new HashSet<>();
	
	static  {
		activityXML.add("RankingActivityTable.xml");
		activityXML.add("RankingActivityRewardTable.xml");
		activityXML.add("LimitRewardTable.xml");
		activityXML.add("RechargeActivityTable.xml");
		activityXML.add("RechargeActivityRewardTable.xml");
		activityXML.add("ShoppingTable.xml");
		activityXML.add("RmbGoodsInfoTable.xml");
		activityXML.add("ShoppingItemTable.xml");
		activityXML.add("RecruitActivityTable.xml");
		activityXML.add("UniversalActivityTable.xml");
		activityXML.add("PrisonerActivityRankRewardTable.xml");
		activityXML.add("KingChaosRankRewardTable.xml");
		activityXML.add("ResGrabActivityTable.xml");
		activityXML.add("ResGrabMapItemTable.xml");
		activityXML.add("ResGrabActivityRewardTable.xml");
		activityXML.add("SpecialActivityTable.xml");
		activityXML.add("IntegralConvertTable.xml");
		activityXML.add("SynthesisTable.xml");
		activityXML.add("WeekRankingActivityTable.xml");
		activityXML.add("WeekRankingActivityRewardTable.xml");
	}
	
	public static String xmlDir = "xml_dir";

	public static void main(String[] args) throws Exception {
		File dir = new File(xmlDir);
		File activityXmlDir = new File(dir, "技术部生成活动表");
		File baseXmlDir = new File(dir, "基础表");
		File[] xmls = dir.listFiles();
		for (File xml : xmls) {
			if (xml.isFile()) {
				File targetDir = activityXML.contains(xml.getName()) ? activityXmlDir : baseXmlDir;
				FileUtils.moveFileToDirectory(xml, targetDir, true);
			}
		}
	}

}
